package com.xiaozhengkeji.blogsuper.utils;

import com.alibaba.fastjson.JSON;
import com.xiaozhengkeji.blogsuper.base.entitys.ArticleClassEntity;

import java.util.List;

/**
 * 文章工具集
 */
public class ArticleUtils {
    /**
     * 判断权限表是否可以访问此文章分类
     */
    public static Boolean isPermissionsTableUseArticleClass(List<String> permissionsTable, ArticleClassEntity articleClassEntity) {
        for (String classPermissions : JSON.parseArray(articleClassEntity.getClassificationAuthority(), String.class)) {
            for (String UsePermissions : permissionsTable) {
                if (classPermissions.equalsIgnoreCase(UsePermissions)) {
                    return true;
                }
            }
        }
        return false;
    }
}
